<script src="https://cdn.staticfile.org/vue/2.7.0/vue.min.js"></script>
<div id="app">
    <input type="text" v-model.number="x">
    <select v-model="fu">
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>
    </select>
    <input type="text" v-model.number="y">
    <button v-on:click="fn()">计算器</button>
    <div>{{val}}</div>
</div>
<script>
    new Vue({
        el: '#app',
        data: {
            fu: '',
            x: '',
            y: '',
            val: '',
        },
        methods: {
            fn() {
                if (this.fu == '+') {
                    this.val = this.x + this.y;
                } else if (this.fu == '-') {
                    this.val = this.x - this.y;
                } else if (this.fu == '*') {
                    this.val = this.x * this.y;
                } else {
                    this.val = this.x / this.y;
                }

            },
        }
    })
</script>